package devcken.hibernate.query;

import java.util.HashMap;
import java.util.Map;

public enum OrderBy
{
	Ascending("ASC"),
	Descending("DESC");
	
	public final String value;
	
	private static final Map<String, OrderBy> _map = new HashMap<String, OrderBy>();
	
	static
	{
		for (OrderBy item : OrderBy.values())
		{
			_map.put(item.value, item);
		}
	}

	OrderBy(String value)
	{
		this.value = value;
	}
	
	public static OrderBy parse(String value)
	{
		return _map.get(value.toUpperCase());
	}
}